<template>
  <div class="kvtransformer">
    <headerc :title="title" :sshow="show"></headerc>
    <el-card class="box-card">
    <!-- <div> -->
      <div class="title-text">数据筛选</div>
      <div style="marginTop: 20px">
        <el-form
          :inline="true"
          label-position="left"
          :label-width="formLabelWidth"
          :model="params"
          class="demo-form-inline"
        >
          <el-form-item label="巡检人">
            <el-select
              v-model="params.Inspector"
              filterable
              remote
              @change="FnQuerySelectInspector"
              reserve-keyword
              placeholder="请输入巡检人"
              :remote-method="FnQueryInspector"
            >
              <el-option
                v-for="item in InspectorArr"
                :key="item.id"
                :label="item.emplName"
                :value="item.id"
              >
              </el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="配电室名称">
            <el-select
              remote
              :remote-method="FnQueryRoomName"
              v-model="params.roomName"
              filterable
              @change="FnQuerySelectRoomName"
              placeholder="请搜索选择配电室"
            >
              <el-option
                v-for="item in params.roomList"
                :key="item.id"
                :label="item.roomName"
                :value="item.id"
              >
              </el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="巡检时间">
            <el-date-picker
              v-model="params.inspectionTime"
              align="right"
              type="date"
              value-format="yyyy-MM-dd"
              placeholder="请选择巡检时间"
            >
            </el-date-picker>
          </el-form-item>
          <el-form-item label="是否上报">
            <el-select v-model="params.noticeLeader" placeholder="请选择">
              <el-option label="是" :value="1"></el-option>
              <el-option label="否" :value="0"></el-option>
            </el-select>
          </el-form-item>
          <div style="marginTop:10px;">
            <el-form-item style="marginLeft:20px;">
            <el-button type="primary" icon="el-icon-search" @click="FnQuery"
              >查询</el-button
            >
          </el-form-item>
          <el-form-item>
            <el-button type="primary" @click="FnReset">清除查询条件</el-button>
          </el-form-item>
          </div>
          
        </el-form>
      </div>
    <!-- </div> -->
    </el-card>
    
    <el-card>
    <div class="c-main-show">
      <div class="main-seting">
        <div>
          <div class="title-text">巡检记录列表</div>
          <el-button
            v-auth="'B02004'"
            type="primary"
            style="
              float: right;
              margin-right: 20px;
              margin-bottom: 20px;
              margin-top: 20px;
            "
            @click="exportExcel"
            >导出</el-button
          >
          <el-button
            v-auth="'B02001'"
            icon="el-icon-circle-plus-outline"
            type="primary"
            @click="FnOpenDialog(1)"
            style="
              float: right;
              margin-right: 20px;
              margin-bottom: 20px;
              margin-top: 20px;
            "
            >新增</el-button
          >

          <!-- 新增或编辑 -->
          <el-dialog
            width="40%"
            :title="dialogTitle"
            :visible.sync="dialog"
            :close-on-click-modal="false"
          >
            <el-form
              :model="formEdit"
              :rules="rules"
              ref="createForm"
              :label-position="labelPosition"
            >
              <!-- 是否上报班组长 -->
              <el-form-item
                label="是否上报班组长"
                :label-width="formLabelWidth"
              >
                <el-select
                  v-if="dialogTitle == '新增巡检记录'"
                  @change="FnSelectLeader"
                  v-model="formEdit.noticeLeader"
                  style="width: 88%"
                  placeholder="请选择"
                >
                  <el-option label="是" :value="1"></el-option>
                  <el-option label="否" :value="0"></el-option>
                </el-select>
                <el-input
                 style="width: 88%"
                  v-if="dialogTitle == '更新巡检记录'"
                  disabled
                  v-model="formEdit.noticeLeader"
                ></el-input>
              </el-form-item>
              <!-- 巡检人 -->
              <el-form-item
                label="巡检人"
                :label-width="formLabelWidth"
                prop="empIds"
              >
                <el-select
                  filterable
                  remote
                  reserve-keyword
                  style="width: 88%"
                  :remote-method="FnSearchMember"
                  @change="changeInspector"
                  v-model="formEdit.Inspector"
                  clearable
                  placeholder="请选择"
                >
                  <el-option
                    v-for="item in InspectorArr"
                    :key="item.id"
                    :label="item.emplName"
                    :value="item.id"
                  >
                  </el-option>
                </el-select>
                <div>
                  <!-- <el-tag
                    v-for="tag in empIdsList"
                    :key="tag.empId"
                    closable
                    type="info"
                  >
                    {{ tag.empNames }}
                  </el-tag> -->
                </div>
              </el-form-item>
              <!-- 巡检时间 -->
              <el-form-item
                label="巡检时间"
                :label-width="formLabelWidth"
                prop="inspectionTime"
              >
                <el-input
                  disabled
                  style="width: 88%"
                  v-model="formEdit.inspectionTime"
                  autocomplete="off"
                ></el-input>
              </el-form-item>
              <!-- 巡检位置 -->
              <el-form-item
                label="巡检位置"
                :label-width="formLabelWidth"
                prop="roomId"
              >
                <el-select
                  style="width: 88%"
                  v-model="formEdit.roomName"
                  remote
                  reserve-keyword
                  filterable
                  @change="FnSelectRoom"
                  placeholder="请输入巡检位置"
                  :remote-method="remoteRoomName"
                >
                  <el-option
                    v-for="item in formEdit.roomList"
                    :key="item.id"
                    :label="item.roomName"
                    :value="item.id"
                  >
                  </el-option>
                </el-select>
              </el-form-item>
              <el-form-item
                label="油位"
                :label-width="formLabelWidth"
                prop="oilLevel"
              >
                <el-input
                  style="width: 88%"
                  v-model="formEdit.oilLevel"
                  autocomplete="off"
                ></el-input>
              </el-form-item>
              <el-form-item
                label="变压器温度"
                :label-width="formLabelWidth"
                prop="transformerTemperature"
              >
                <el-input
                  style="width: 88%"
                  v-model="formEdit.transformerTemperature"
                  autocomplete="off"
                ></el-input>
              </el-form-item>
              <el-form-item
                label="变压器有无异响"
                :label-width="formLabelWidth"
                prop="errorSound"
              >
                <el-select
                  v-model="formEdit.errorSound"
                  style="width: 88%"
                  placeholder="请选择"
                >
                  <el-option label="有" :value="1"></el-option>
                  <el-option label="无" :value="0"></el-option>
                </el-select>
              </el-form-item>
              <el-form-item
                label="有无渗漏现象"
                :label-width="formLabelWidth"
                prop="seepage"
              >
                <el-select
                  v-model="formEdit.seepage"
                  style="width: 88%"
                  placeholder="请选择"
                >
                  <el-option label="有" :value="1"></el-option>
                  <el-option label="无" :value="0"></el-option>
                </el-select>
              </el-form-item>
              <el-form-item
                label="低压母线接头温度"
                :label-width="formLabelWidth"
                prop="lowPressureTemperature"
              >
                <el-input
                  style="width: 88%"
                  v-model="formEdit.lowPressureTemperature"
                  autocomplete="off"
                ></el-input>
              </el-form-item>
              <el-form-item
                label="高压母线接头温度"
                :label-width="formLabelWidth"
                prop="highPressureTemperature"
              >
                <el-input
                  style="width: 88%"
                  v-model="formEdit.highPressureTemperature"
                  autocomplete="off"
                ></el-input>
              </el-form-item>
              <el-form-item
                label="继电器内是否有气体"
                :label-width="formLabelWidth"
                prop="gas"
              >
                <el-select
                  v-model="formEdit.gas"
                  style="width: 88%"
                  placeholder="请选择"
                >
                  <el-option label="是" :value="1"></el-option>
                  <el-option label="否" :value="0"></el-option>
                </el-select>
              </el-form-item>
              <el-form-item
                label="硅胶是否变色"
                :label-width="formLabelWidth"
                prop="changeColor"
              >
                <el-select
                  v-model="formEdit.changeColor"
                  style="width: 88%"
                  placeholder="请选择"
                >
                  <el-option label="是" :value="1"></el-option>
                  <el-option label="否" :value="0"></el-option>
                </el-select>
              </el-form-item>

              <el-form-item label="备注" :label-width="formLabelWidth">
                <el-input
                  type="textarea"
                  style="width: 88%"
                  v-model="formEdit.questionResult"
                  autocomplete="off"
                ></el-input>
              </el-form-item>
            </el-form>
            <div slot="footer" class="dialog-footer">
              <el-button @click="quxiao">取 消</el-button>
              <el-button
                v-if="dialogTitle == '更新巡检记录'"
                type="primary"
                @click="FnUpdate"
              >
                更 新</el-button
              >
              <el-button
                v-if="dialogTitle == '新增巡检记录'"
                type="primary"
                @click="FnSave"
              >
                提交</el-button
              >
            </div>
          </el-dialog>
          <div style="margin: 20px">
            <el-table :data="tableData" border style="width: 100%">
              <el-table-column width="170" label="巡检日期">
                <template slot-scope="scope">
                  <span>{{ timefun(scope.row.inspectionTime) }}</span>
                </template>
              </el-table-column>
              <el-table-column prop="roomName" label="巡检位置" width="150px">
              </el-table-column>
              <el-table-column prop="oilLevel" label="油位"> </el-table-column>
              <el-table-column
                prop="transformerTemperature"
                label="变压器温度≤65℃"
              >
              </el-table-column>
              <el-table-column label="变压器有无异响">
                <template slot-scope="scope">
                  <span>{{ scope.row.errorSound ? "有" : "无" }}</span>
                </template>
              </el-table-column>
              <el-table-column label="有无渗漏情况">
                <template slot-scope="scope">
                  <span>{{ scope.row.seepage ? "有" : "无" }}</span>
                </template>
              </el-table-column>
              <el-table-column
                prop="highPressureTemperature"
                label="高压母线接头温度≤65℃"
              >
              </el-table-column>
              <el-table-column
                prop="lowPressureTemperature"
                label="低压母线接头温度≤65℃"
              >
              </el-table-column>
              <el-table-column label="继电器内是否有气体">
                <template slot-scope="scope">
                  <span>{{ scope.row.gas ? "是" : "否" }}</span>
                </template>
              </el-table-column>
              <el-table-column label="硅胶是否变色">
                <template slot-scope="scope">
                  <span>{{ scope.row.changeColor ? "是" : "否" }}</span>
                </template>
              </el-table-column>
              <el-table-column label="是否上报">
                <template slot-scope="scope">
                  <span>{{ scope.row.noticeLeader ? "是" : "否" }}</span>
                </template>
              </el-table-column>
              <el-table-column label="巡检人" :show-overflow-tooltip="true">
                <template slot-scope="scope">
                  <span
                    style="
                      overflow: hidden;
                      text-overflow: ellipsis;
                      white-space: nowrap;
                      width: 100px;
                    "
                    >{{ scope.row.empNames }}</span
                  >
                </template>
              </el-table-column>
              <el-table-column prop="questionResult" label="备注">
              </el-table-column>
              <el-table-column
                prop="num"
                label="操作"
                width="150px"
                fixed="right"
              >
                <template slot-scope="scope">
                  <el-button
                    @click="FnDeal(scope.row)"
                    type="text"
                    size="small"
                    v-show="scope.row.noticeLeader && !scope.row.leaderDeal"
                    >待处理</el-button
                  >
                  <el-button
                    v-auth="'B02003'"
                    @click="handleClick(scope.row)"
                    type="text"
                    size="small"
                    >编辑</el-button
                  >
                </template>
              </el-table-column>
            </el-table>
          </div>
          <div class="fenye">
            <el-pagination
              background
              layout="prev, pager, next"
              :page-size="pageSize"
              :total="total"
              :current-page.sync="currentPage"
              :hide-on-single-page="total < 10"
              @current-change="currentChange"
              style="margin-left: 25%"
            >
            </el-pagination>
          </div>
        </div>
      </div>
    </div>
    </el-card>
  </div>
</template>

<script>
import headerc from "@/components/header.vue";
import { exportMethod, getTime } from "@/utils/utils";
import {
  kvtransadd,
  kvtransformerGetById,
  kvtransgetQuery,
  kvtransupdate,
  pdroomgetAllByRoomName,
  getlists,
  modelNameIndex,
  kvtransformerDeal,
} from "../../../api/patrol-record";
import utils from "@/utils/utils";
export default {
  components: {
    headerc,
  },
  data() {
    return {
      currentPage: 1,
      labelPosition: "left",
      title: "10KV变压器巡检记录列表",
      empIdsList: [],
      dialogTitle: "",
      restaurants: [],
      restaurants2: [],
      state: "",
      timeout: null,
      uid: "",
      updata: 1,
      pageNo: 1,
      pageSize: 10,
      total: 0,
      dialog: false,
      rules: {
        noticeLeader: [
          {
            required: true,
            message: "是否上报班组长不能为空",
            trigger: "blur",
          },
        ],
        empIds: [
          {
            required: true,
            message: "巡检人不能为空",
            trigger: "blur",
          },
        ],
        inspectionTime: [
          { required: true, message: "巡检时间不能为空", trigger: "blur" },
        ],
        roomId: [
          {
            required: true,
            message: "巡检位置",
            trigger: "change",
          },
        ],
        oilLevel: [
          { required: true, message: "油位不能为空", trigger: "blur" },
        ],

        transformerTemperature: [
          { required: true, message: "变压器温度不能为空", trigger: "blur" },
        ],
        errorSound: [
          {
            required: true,
            message: "变压器有无异响不能为空",
            trigger: "change",
          },
        ],
        seepage: [
          {
            required: true,
            message: "有无渗漏现象不能为空",
            trigger: "change",
          },
        ],
        lowPressureTemperature: [
          {
            required: true,
            message: "低压母线接头温度不能为空",
            trigger: "blur",
          },
        ],

        highPressureTemperature: [
          {
            required: true,
            message: "高压母线接头温度不能为空",
            trigger: "blur",
          },
        ],

        gas: [
          {
            required: true,
            message: "继电器内是否有气体不能为空",
            trigger: "change",
          },
        ],
        changeColor: [
          {
            required: true,
            message: "硅胶是否变色不能为空",
            trigger: "change",
          },
        ],
      },
      // 表单
      formEdit: {
        id: "",
        inspectionTime: "",
        oilLevel: 0,
        transformerTemperature: "",
        errorSound: 1,
        errorSoundLable: "无",
        seepage: "",
        lowPressureTemperature: "",
        highPressureTemperature: "",
        gas: "",
        changeColor: "",
        empIds: "",
        Inspector: "",
        remark: "",
        roomId: "",
        roomName: "",
        roomList: [],
        noticeLeader: "",
        creatorId: "",
        deptId: "",
        questionResult: "",
        leaderDeal: 1,
        errorSoundList: [
          {
            label: "无",
            value: 0,
          },
          {
            label: "有",
            value: 1,
          },
        ],
      },
      formLabelWidth: "130px",
      show: true,
      params: {
        //巡检人
        empId: "",
        //巡检位置
        roomName: "",
        roomId: "",
        // 巡检位置数组
        roomList: [],
        // 巡检时间
        inspectionTime: "",
        noticeLeader: "",

        //变压器有无异响
      },
      formInline: {
        user: "",
        region: "",
        value1: "",
        mingcheng: "",
        noticeLeader: "",
        empIds: "",
        roomName: "",
      },
      tableData: [],
      InspectorArr: [],
    };
  },
  created() {
    let params = {
      pageNo: 1,
      pageSize: 10,
    };
    this.getkvtransget(params);
  },
  methods: {
    //筛选条件 查询配电室名字
    FnQueryRoomName(val) {
      console.log(val);
      console.log("===val===");
      pdroomgetAllByRoomName({
        roomName: val,
        recordType: 1,
      }).then((res) => {
        console.log(res);
        console.log("===res===");
        if (res.code == 200) {
          this.params.roomList = res.data;
        }
      });
    },
    // 选择配电室
    FnQuerySelectRoomName(val) {
      console.log(val);
      this.params.roomId = val;
    },
    //选择巡检人
    FnQuerySelectInspector(val) {
      console.log(val);

      this.params.empId = val;
    },
    // 查询条件
    FnQueryInspector(val) {
      getlists({
        deptId: "",
        emplName: val,
        userType: "1",
      }).then((res) => {
        this.InspectorArr = res.data;
        // console.log(this.params.InspectorArr);
      });
    },
    FnSelectLeader(val) {
      console.log(val);
    },
    //选择
    FnSelectRoom(val) {
      console.log(val);
      console.log("===val===");
      this.formEdit.roomId = val;
    },
    //表单 查配电室
    remoteRoomName(val) {
      console.log(val);
      //模糊查询配电室名称
      pdroomgetAllByRoomName({
        roomName: val,
        recordType: 1,
      }).then((res) => {
        console.log(res);
        console.log("===res===");
        if (res.code == 200) {
          this.formEdit.roomList = res.data;
        }
        // this.restaurants2 = res.data;
      });
    },
    //保存
    FnSave() {
      this.$refs.createForm.validate((valid) => {
        if (valid) {
          kvtransadd(this.formEdit).then((res) => {
            console.log(res);
            console.log("===res====");
            if (res.code == 200) {
              this.dialog = false;
              let params = {
                ...this.params,
                pageNo: this.currentPage,
                pageSize: 10,
              };
              this.$message({
                type:'success',
                message:'新增成功'
              })
              this.getkvtransget(params);
            }
          });
        }
      });
    },
    //打开弹窗
    FnOpenDialog(val) {
      console.log(val);
      console.log("===val===");
      //修改
      if (val == 0) {
        this.dialogTitle = "更新巡检记录";
      }
      //新增
      else {
        this.dialogTitle = "新增巡检记录";
        // this.formEdit.inspectionTime = getTime();

        // this.formEdit.inspectionTime = getTime();

        // console.log("====this.formEdit.inspectionTime====");
        //默认 系统时间

        //清空表单
        Object.keys(this.formEdit).map((key) => {
          this.formEdit[key] = "";
        });
        // 默认时间
        this.formEdit.inspectionTime = getTime();
        // 巡检人
        let obj = JSON.parse(localStorage.getItem("userInfo"));
        this.formEdit.empIds = obj.userId;
        this.formEdit.Inspector = obj.name;
         this.formEdit.noticeLeader = '否'

        this.$nextTick(() => {
          // console.log(this.$refs.createForm)
          // console.log('======createForm======')
          this.$refs.createForm.clearValidate();
        });
      }
      //新增还是修改
      this.dialog = true;
    },
    // 导出
    exportExcel() {
      const data = {
        pageNo: this.pageNo,
        pageSize: 5000,
        inspectionTime:
          utils.formatDate(this.formInline.value1, "yyyy-MM-dd") && "",
        empId: this.formEdit.empIds,
        roomId: this.formInline.roomName,
        // roomId:this.form11.roomId,
        noticeLeader: this.formInline.noticeLeader,
      };
      exportMethod("kvTransformerRecord", data, "10KV变压器巡检记录");
    },
    modelNameIndex() {
      modelNameIndex("kvTransformerRecord", { pageNo: 1, pageSize: 100 }).then(
        (res) => {}
      );
    },
    FnSearchMember(val) {
      getlists({
        deptId: "",
        emplName: val,
        userType: "1",
      }).then((res) => {
        this.InspectorArr = res.data;
        console.log(this.params.InspectorArr);
      });
    },
    changeInspector(val) {
      console.log(val);
      this.formEdit.empIds = val;
    },
    newsele() {},
    // querySearchAsync2(queryString, cb) {
    //   var restaurants = this.restaurants2;
    //   var results = queryString
    //     ? restaurants.filter(this.createStateFilter2(queryString))
    //     : restaurants;

    //   clearTimeout(this.timeout);
    //   this.timeout = setTimeout(() => {
    //     cb(results);
    //   }, 0);
    // },
    // querySearchAsync(queryString, cb) {
    //   var restaurants = this.restaurants;
    //   var results = queryString
    //     ? restaurants.filter(this.createStateFilter(queryString))
    //     : restaurants;

    //   clearTimeout(this.timeout);
    //   this.timeout = setTimeout(() => {
    //     cb(results);
    //   }, 0);
    // },
    // createStateFilter2(queryString) {
    //   return (state) => {
    //     console.log(state);
    //     return state.roomName.indexOf(queryString.toLowerCase()) != -1;
    //   };
    // },
    // createStateFilter(queryString) {
    //   return (state) => {
    //     console.log(state, queryString.toLowerCase());
    //     return state.emplName.indexOf(queryString.toLowerCase()) != -1;
    //   };
    // },
    // handleinput(item) {
    //   this.formInline.user = item.roomName;
    //   this.formEdit.roomId = item.id;
    // },
    quxiao() {
      this.dialogFormVisible = false;
      this.dialog = false;
    },
    timefun(data) {
      return utils.formatDate(data, "yyyy-MM-dd HH:mm:ss");
    },
    //改变页数
    currentChange(val) {
      console.log(val);

      // this.pageNo = pageNo;
      let params = {
        ...this.params,
        pageNo: val,
        pageSize: 10,
      };
      this.getkvtransget(params);
    },
    // 查询接口
    getkvtransget(params) {
      kvtransgetQuery(params).then((res) => {
        this.tableData = res.data.list;
        this.total = res.data.total;
      });
    },
    //修改
    FnUpdate() {
      this.$refs.createForm.validate((valid) => {
        if (valid) {
          this.formEdit.noticeLeader == "是"
            ? (this.formEdit.noticeLeader = 1)
            : (this.formEdit.noticeLeader = 0);
          kvtransupdate(this.formEdit).then((res) => {
            if (res.code == 200) {
              this.$message({
                message: "更新成功",
                type: "success",
              });
              this.dialog = false;
              let params = {
                ...this.params,
                pageNo: this.currentPage,
                pageSize: 10,

                // empIds: this.params.empIds,
                // roomId: this.params.roomId,
                // inspectionTime: this.params.inspectionTime,
              };

              this.getkvtransget(params);
            }
          });
        }
      });
    },
    //打开编辑弹窗 调详情接口
    handleClick(val) {
      console.log(JSON.parse(localStorage.getItem("userInfo")));
      console.log("99999");
      this.FnOpenDialog(0);
      //调详情接口
      console.log(val.id);
      kvtransformerGetById(val.id).then((res) => {
        console.log(res);
        console.log("===res===");
        if (res.code == "200") {
          // 巡检日期
          this.formEdit.inspectionTime = utils.formatDate(
            res.data.inspectionTime,
            "yyyy-MM-dd HH:mm:ss"
          );
          //油位
          this.formEdit.oilLevel = res.data.oilLevel;
          //变压器温度
          this.formEdit.transformerTemperature =
            res.data.transformerTemperature;
          res.data.errorSound
            ? (this.formEdit.errorSound = 1)
            : (this.formEdit.errorSound = 0);

          // 有无渗漏现象
          res.data.seepage
            ? (this.formEdit.seepage = 1)
            : (this.formEdit.seepage = 0);
          res.data.gas ? (this.formEdit.gas = 1) : (this.formEdit.gas = 0);
          res.data.changeColor
            ? (this.formEdit.changeColor = 1)
            : (this.formEdit.changeColor = 0);
          // 低压母线接头温度≤65℃
          this.formEdit.lowPressureTemperature =
            res.data.lowPressureTemperature;
          //高压母线接头温度
          this.formEdit.highPressureTemperature =
            res.data.lowPressureTemperature;
          //巡检人

          //给表单赋值
          this.formEdit.Inspector = res.data.empNames;
          this.formEdit.empIds = res.data.empList[0].empId;
          // 巡检人赋值
          // this.formEdit.Inspector.push({
          //   id:obj.userId,
          //   emplName:obj.name
          // });

          this.formEdit.id = res.data.id;
          this.empIdsList.push({
            empIds: this.formEdit.empIds,
            empNames: this.formEdit.Inspector,
          });
          console.log(this.formEdit.id);
          console.log("====this.formEdit.id====");
          //备注
          this.formEdit.questionResult = res.data.questionResult;
          // 巡检位置
          this.formEdit.roomName = res.data.roomName;
          this.formEdit.roomId = res.data.roomId;
          console.log(res.data.roomName);
          console.log("0000000");
          console.log(res.data.roomId);
          //是否上报班组长
          this.formEdit.noticeLeader = res.data.noticeLeader ? '是' : '否';
        }
        // console.log(this.formEdit.Inspector + "sfsdf");
      });
    },
    FnQuery() {
      let params = {
        ...this.params,
        pageNo: 1,
        pageSize: 10,
      };

      this.currentPage = 1;

      this.getkvtransget(params);
    },
    // 重置
    FnReset() {
      Object.keys(this.params).forEach((key) => {
        this.params[key] = "";
      });
      this.currentPage = 1;
    },
    // 已处理
    FnDeal(val) {
      console.log(val);
      console.log("===val==");
      this.$confirm("请确认异常是否已处理完毕?", "确认提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          console.log("确定");
          kvtransformerDeal({ recordId: val.id })
            .then((res) => {
              if (res.code == 200) {
                let params = {
                  ...this.params,
                  pageSize: 10,
                  pageNo: this.currentPage,
                };
                this.getkvtransget(params);
                this.$message({
                  type: "success",
                  message: "处理成功!",
                });
              }
            })
            .catch((error) => {
              console.log(error);
            });
        })
        .catch(() => {
          console.log("取消");
        });
    },
    handleSizeChange() {},
    handleCurrentChange() {},
  },
};
</script>
<style lang="scss">
.kvtransformer {
  .el-form--inline .el-form-item__label{
    padding-left: 22px;
  }
  .kvtransformer-Query {
    margin-top: 40px;
  }
}
</style>
<style lang="scss" scoped>
.box-card {
  margin-bottom: 20px;
}

.c-main-make {
   background: #fff;
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
  border: 1px #dcdee0 solid;
}

.c-main-show {
  padding-bottom: 20px;
  background: #fff;
  position: relative;
  overflow: hidden;
  border: 1px #dcdee0 solid;
  // margin-left: 35px;
  // background: #fff;
  // margin-right: 35px;
  // margin-bottom: 35px;
  // position: relative;
  // overflow: hidden;
  // border: 1px #dcdee0 solid;
}
.title-text {
  width: 100%;
  height: 50px;
  border-bottom: 1px #dcdee0 solid;
  font-family: "微软雅黑 Bold", "微软雅黑 Regular", 微软雅黑, sans-serif;
  font-weight: 700;
  color: #666666;
  line-height: 50px;
  padding-left: 25px;
}
.fenye {
  display: flex;
  justify-content: right;
}
</style>
